<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<LCA.Community.DAL.Model.Message>" %>
<%@ Import Namespace="LCA.Community.DAL.Model" %>
<%@ Import Namespace="Microsoft.Web.Mvc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeaderContent" runat="server">
    <script src="<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>" type="text/javascript"></script>
    <script src="<%= Url.Content("~/Scripts/MicrosoftMvcValidation.js") %>" type="text/javascript"></script>     
    <script src="<%= Url.Content("~/Scripts/tiny_mce/tiny_mce.js") %>" type="text/javascript"></script>
    <script type="text/javascript">
        tinyMCE.init({
            mode: "textareas",
            theme: "advanced",
            plugins: "emotions,preview,searchreplace,insertdatetime",
            theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect,|,hr,removeformat,visualaid,|,charmap",
            theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,emotions,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor,|,sub,sup",
            theme_advanced_buttons3: "",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left"
        });
    </script> 
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content-main">
        <h2><img src="<%= Url.Content("~/Content/images/FinalDesign/Icons/mail_add24.png") %>" />Nuevo Mensaje</h2>
        <p>Rellene el siguiente formulario para enviar un mensaje al usuario que desee.</p>
        <% Html.EnableClientValidation(); %>
        <%using (Html.BeginForm("Create", "Mailbox", new { id = ViewData["ID"] }, FormMethod.Post, new { id = "NewMessageForm" })){ %>
                <table cellspacing="10">
                    <tr>
                        <td>
                            <label for="receivers">Para:</label>
                        </td>
                        <td>
                            <%= Html.TextBox("receivers", "", new { size = "100", @class = "{required:true, messages:{required:'Debe introducir los destinatarios.'}}" })%>           
                            <%= Html.ValidationMessage("Receivers") %>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <%= Html.LabelFor(m => m.Subject) %>
                        </td>
                        <td>
                            <%= Html.TextBoxFor(m => m.Subject, new { size = "100", @class = "{required:true, messages:{required:'Debe introducir el asunto.'}}" })%>    
                            <%= Html.ValidationMessageFor(m => m.Subject) %>
                        </td>
                    </tr>
                </table>                   
                <%= Html.LabelFor(m => m.Body)%>
                <%= Html.TextAreaFor(m => m.Body, new { style = "width:95%;height:300px;"})%>
                <%= Html.ValidationMessageFor(m => m.Body) %>
                <br />
                <%= Html.SubmitButton("Submit", "Enviar")%>
        <%} %>
        
    </div>
    
    <div class="content-right">
        <% if ((bool)ViewData["isuser"])
           {
               Html.RenderPartial("UserMenu", ViewData["user"]);
           }
           else
           {
               Html.RenderPartial("GroupMenu", ViewData["group"]);
           } %>
    </div>
</asp:Content>
